<?php

function smarty_function_load($params, &$smarty)
{
	$file = $params['file'];
	
	$__app_dir = TPLPATH;
	$__core_dir = str_replace( 'app', 'core', TPLPATH );
	
	if( is_readable( $__app_dir.$file ) ) $file = $__app_dir.$file;
	elseif( is_readable( $__core_dir.$file ) ) $file = $__core_dir.$file;
	
	return $smarty ->fetch( $file );
}

?>
